package com.sls.game.parser.nutsnet;

import java.io.StringReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;

import org.apache.log4j.Logger;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;

import com.sls.game.pojo.nutsnet.AccountTypeInfo;
import com.sls.game.pojo.nutsnet.ChargeTypeInfo;
import com.sls.game.pojo.nutsnet.ChooseGemInfo;
import com.sls.game.pojo.nutsnet.NutsNetGoodsAreaInfo;
import com.sls.game.pojo.nutsnet.NutsNetGoodsDetailTop;
import com.sls.game.pojo.nutsnet.NutsNetGoodsServerInfo;

/**
 * 
 * @description 以dom方式解析坚果网络响应的xml文件内容
 * @author Wangxuegang
 * @date 2012-10-13
 * 
 */
public class NutsNetResponseDomParseXml {

	private static Logger log = Logger
			.getLogger(NutsNetResponseDomParseXml.class);

	/**
	 * 解析坚果网络商品详细内容
	 * 
	 * @param xmlStr
	 * @param goodsId
	 *            商品编号
	 * @data 2012-11-01
	 * @return
	 */
	public static Map<String, Object> parseXmlOfGoodsDetailForTrade(
			String xmlStr, String goodsId) {
		InputSource source = null;
		StringReader read = null;
		Map<String, Object> map = new HashMap<String, Object>();
		// 商品充值类型（按金额“元”充或者按数量“张”充）
		String caption = "";
		String nutsorder = "";
		String type = "";
		String gamecompany = "";
		String gametype = "";
		String gameuntil = "";
		String username = "";
		String noteinfo = "";
		NutsNetGoodsDetailTop nutsNetGoodsDetailTop = new NutsNetGoodsDetailTop();
		List<NutsNetGoodsDetailTop> goodsdetailTopList = new ArrayList<NutsNetGoodsDetailTop>();
		nutsNetGoodsDetailTop.setGoodsId(goodsId);

		// 临时加入
		// InputStream xmlStream = Parser.class.getClassLoader()
		// .getResourceAsStream("Test.xml");

		try {
			// 得到DOM解析器的工厂实例
			DocumentBuilderFactory dbFactory = DocumentBuilderFactory
					.newInstance();
			// 从DOM工厂中获得DOM解析器
			DocumentBuilder dbBuilder = dbFactory.newDocumentBuilder();
			read = new StringReader(xmlStr);
			source = new InputSource(read);

			// 把要解析的xml文档读入DOM解析器
			Document doc = dbBuilder.parse(source);
			Element root = doc.getDocumentElement();
//			log.info("根元素：" + root.getNodeName());
			NodeList childNodes = root.getChildNodes(); // 获得根元素下的子节点
			// 遍历子节点
			for (int i = 0; i < childNodes.getLength(); i++) {
				Node node = childNodes.item(i); // 对每个子节点进行判断

				if ("caption".equals(node.getNodeName())) {
					caption = node.getTextContent();
					nutsNetGoodsDetailTop.setCaption(caption);

				} else if ("order".equals(node.getNodeName())) { // 第二层节点
					nutsorder = node.getTextContent();
					nutsNetGoodsDetailTop.setNutsorder(nutsorder);

				} else if ("type".equals(node.getNodeName())) { // 第二层节点
					type = node.getTextContent();
					nutsNetGoodsDetailTop.setType(type);

				} else if ("gamecompany".equals(node.getNodeName())) { // 第二层节点
					gamecompany = node.getTextContent();
					nutsNetGoodsDetailTop.setGamecompany(gamecompany);

				} else if ("gametype".equals(node.getNodeName())) { // 第二层节点
					gametype = node.getTextContent();
					nutsNetGoodsDetailTop.setGametype(gametype);

				} else if ("gameuntil".equals(node.getNodeName())) { // 第二层节点
					gameuntil = node.getTextContent();
					nutsNetGoodsDetailTop.setGameuntil(gameuntil);

				} else if ("username".equals(node.getNodeName())) { // 第二层节点
					username = node.getTextContent();
					nutsNetGoodsDetailTop.setUsername(username);

				} else if ("savenote".equals(node.getNodeName())) { // 第二层节点
					Element savenote = (Element) node.getChildNodes();
					NodeList savenoteNodes = savenote.getChildNodes();
					for (int j = 0; j < savenoteNodes.getLength(); j++) {
						Node savenoteNode = savenoteNodes.item(j);
						if ("noteinfo".equals(savenoteNode.getNodeName())) {
							noteinfo = savenoteNode.getTextContent();
							nutsNetGoodsDetailTop.setNoteinfo(noteinfo);
						}
					}
				} else if ("chargetype_s".equals(node.getNodeName())) { // 第二层节点
					Element chargetype_s = (Element) node.getChildNodes();
					NodeList chargetype_sNodes = chargetype_s.getChildNodes();

					List<ChargeTypeInfo> chargetypeList = new ArrayList<ChargeTypeInfo>();
					List<ChooseGemInfo> chooseGemInfoList = new ArrayList<ChooseGemInfo>();
					List<NutsNetGoodsAreaInfo> nutsNetGoodsAreaInfoList = new ArrayList<NutsNetGoodsAreaInfo>();
					List<NutsNetGoodsServerInfo> nutsNetGoodsServerInfoList = new ArrayList<NutsNetGoodsServerInfo>();
					for (int j = 0; j < chargetype_sNodes.getLength(); j++) {
						Node chargetype_sNode = chargetype_sNodes.item(j);
						if ("chargetype".equals(chargetype_sNode.getNodeName())) {
							Element chargetype = (Element) chargetype_sNode
									.getChildNodes();
							NodeList chargetypeNodes = chargetype
									.getChildNodes();

							ChargeTypeInfo chargeTypeInfo = new ChargeTypeInfo();
							chargeTypeInfo.setGoodsId(goodsId);
							for (int k = 0; k < chargetypeNodes.getLength(); k++) {
								Node chargetypeNode = chargetypeNodes.item(k);
								if ("name".equals(chargetypeNode.getNodeName())) {
									String name = chargetypeNode
											.getTextContent();
									chargeTypeInfo.setChargetypeName(name);
								} else if ("id".equals(chargetypeNode
										.getNodeName())) {
									String id = chargetypeNode.getTextContent();
									chargeTypeInfo.setChargetypeId(id);
								} else if ("buynumber_list"
										.equals(chargetypeNode.getNodeName())) {
									String buynumber_list = chargetypeNode
											.getTextContent();
									chargeTypeInfo
											.setBuynumber_list(buynumber_list);

								} else if ("number_list".equals(chargetypeNode
										.getNodeName())) {
									String number_list = chargetypeNode
											.getTextContent();
									chargeTypeInfo
											.setBuynumber_list(number_list);
								} else if ("tbuynumber_list"
										.equals(chargetypeNode.getNodeName())) {
									String tbuynumber_list = chargetypeNode
											.getTextContent();
									chargeTypeInfo
											.setTbuynumber_list(tbuynumber_list);
								} else if ("tbuynumbername"
										.equals(chargetypeNode.getNodeName())) {
									String tbuynumbername = chargetypeNode
											.getTextContent();
									chargeTypeInfo
											.setTbuynumbername(tbuynumbername);
								} else if ("gamearea_s".equals(chargetypeNode
										.getNodeName())) {
									Element gamearea_s = (Element) chargetypeNode
											.getChildNodes();
									NodeList gamearea_sNodes = gamearea_s
											.getChildNodes();
									for (int l = 0; l < gamearea_sNodes
											.getLength(); l++) {
										Node gamearea_sNode = gamearea_sNodes
												.item(l);
										if ("gamearea".equals(gamearea_sNode
												.getNodeName())) {
											Element gamearea = (Element) gamearea_sNode
													.getChildNodes();
											NodeList gameareaNodes = gamearea
													.getChildNodes();

											NutsNetGoodsAreaInfo nutsNetGoodsAreaInfo = new NutsNetGoodsAreaInfo();
											nutsNetGoodsAreaInfo
													.setGoodsId(goodsId);
											nutsNetGoodsAreaInfo
													.setChargetypeName(chargeTypeInfo
															.getChargetypeName());
											nutsNetGoodsAreaInfo
													.setChargetypeId(chargeTypeInfo
															.getChargetypeId());
											for (int m = 0; m < gameareaNodes
													.getLength(); m++) {
												Node gameareaNode = gameareaNodes
														.item(m);
												if ("name".equals(gameareaNode
														.getNodeName())) {
													String name = gameareaNode
															.getTextContent();
													nutsNetGoodsAreaInfo
															.setGameAreaName(name);
												} else if ("id"
														.equals(gameareaNode
																.getNodeName())) {
													String id = gameareaNode
															.getTextContent();
													nutsNetGoodsAreaInfo
															.setGameAreaId(id);
												} else if ("gamesrv_s"
														.equals(gameareaNode
																.getNodeName())) {
													Element gamesrv_s = (Element) gameareaNode
															.getChildNodes();
													NodeList gamesrv_sNodes = gamesrv_s
															.getChildNodes();
													for (int n = 0; n < gamesrv_sNodes
															.getLength(); n++) {
														Node gamesrv_sNode = gamesrv_sNodes
																.item(n);
														if ("gamesrv"
																.equals(gamesrv_sNode
																		.getNodeName())) {
															Element gamesrv = (Element) gamesrv_sNode
																	.getChildNodes();
															NodeList gamesrvNodes = gamesrv
																	.getChildNodes();

															NutsNetGoodsServerInfo nutsNetGoodsServerInfo = new NutsNetGoodsServerInfo();
															nutsNetGoodsServerInfo
																	.setGoodsId(goodsId);
															nutsNetGoodsServerInfo
																	.setGameAreaName(nutsNetGoodsAreaInfo
																			.getGameAreaName());
															nutsNetGoodsServerInfo
																	.setGameAreaId(nutsNetGoodsAreaInfo
																			.getGameAreaId());
															nutsNetGoodsServerInfo
																	.setChargetypeName(chargeTypeInfo
																			.getChargetypeName());
															nutsNetGoodsServerInfo
																	.setChargetypeId(chargeTypeInfo
																			.getChargetypeId());
															for (int o = 0; o < gamesrvNodes
																	.getLength(); o++) {
																Node gamesrvNode = gamesrvNodes
																		.item(o);
																if ("name"
																		.equals(gamesrvNode
																				.getNodeName())) {
																	String name = gamesrvNode
																			.getTextContent();
																	nutsNetGoodsServerInfo
																			.setGamesrvName(name);
																} else if ("id"
																		.equals(gamesrvNode
																				.getNodeName())) {
																	String id = gamesrvNode
																			.getTextContent();
																	nutsNetGoodsServerInfo
																			.setGamesrvId(id);
																}
															}
															// 把该对象中的值插入到数据库(nutsnet_game_server_info数据表中)
															nutsNetGoodsServerInfoList
																	.add(nutsNetGoodsServerInfo);
															map.put("nutsNetGoodsServerInfo",
																	nutsNetGoodsServerInfoList);
														}
													}
												}
											}
											// 把该对象中的值插入到数据库(nutsnet_game_area_info数据表中)
											nutsNetGoodsAreaInfoList
													.add(nutsNetGoodsAreaInfo);
											map.put("nutsNetGoodsAreaInfoList",
													nutsNetGoodsAreaInfoList);
										}
									}
								} else if ("choosegem_s".equals(chargetypeNode
										.getNodeName())) {
									Element choosegem_s = (Element) chargetypeNode
											.getChildNodes();
									NodeList choosegem_sNodes = choosegem_s
											.getChildNodes();

									for (int l = 0; l < choosegem_sNodes
											.getLength(); l++) {
										Node choosegem_sNode = choosegem_sNodes
												.item(l);
										if ("choosegem".equals(choosegem_sNode
												.getNodeName())) {
											Element choosegem = (Element) choosegem_sNode
													.getChildNodes();
											NodeList choosegemNodes = choosegem
													.getChildNodes();

											ChooseGemInfo chooseGemInfo = new ChooseGemInfo();
											chooseGemInfo.setGoodsId(goodsId);
											chooseGemInfo
													.setChargeTypeName(chargeTypeInfo
															.getChargetypeName());
											chooseGemInfo
													.setChargeTypeId(chargeTypeInfo
															.getChargetypeId());
											for (int m = 0; m < choosegemNodes
													.getLength(); m++) {
												Node choosegemNode = choosegemNodes
														.item(m);
												if ("name".equals(choosegemNode
														.getNodeName())) {
													String name = choosegemNode
															.getTextContent();
													chooseGemInfo
															.setChoosegemName(name);
												} else if ("id"
														.equals(choosegemNode
																.getNodeName())) {
													String id = choosegemNode
															.getTextContent();
													chooseGemInfo
															.setChoosegemId(id);
												}
											}
											// 把该对象中的值插入到数据库(nutsnet_choosegem_info数据表中)
											chooseGemInfoList
													.add(chooseGemInfo);
											map.put("chooseGemInfoList",
													chooseGemInfoList);
										}
									}
								}
							}
							// 把该对象中的值插入到数据库（nutsnet_charge_type_info数据表中）
							chargeTypeInfo.setGameuntil(gameuntil);
							chargetypeList.add(chargeTypeInfo);
							map.put("chargetypeList", chargetypeList);
						}
					}
				} else if ("gamearea_s".equals(node.getNodeName())) { // 第二层节点
					Element gamearea_s = (Element) node.getChildNodes();
					NodeList gamearea_sNodes = gamearea_s.getChildNodes();

					List<NutsNetGoodsAreaInfo> nutsNetGoodsAreaInfoList = new ArrayList<NutsNetGoodsAreaInfo>();
					List<NutsNetGoodsServerInfo> nutsNetGoodsServerInfoList = new ArrayList<NutsNetGoodsServerInfo>();
					for (int j = 0; j < gamearea_sNodes.getLength(); j++) {
						Node gamearea_sNode = gamearea_sNodes.item(j);
						if ("gamearea".equals(gamearea_sNode.getNodeName())) {
							Element gamearea = (Element) gamearea_sNode
									.getChildNodes();
							NodeList gameareaNodes = gamearea.getChildNodes();

							NutsNetGoodsAreaInfo nutsNetGoodsAreaInfo = new NutsNetGoodsAreaInfo();
							nutsNetGoodsAreaInfo.setGoodsId(goodsId);
							for (int k = 0; k < gameareaNodes.getLength(); k++) {
								Node gameareaNode = gameareaNodes.item(k);
								if ("name".equals(gameareaNode.getNodeName())) {
									String name = gameareaNode.getTextContent();
									nutsNetGoodsAreaInfo.setGameAreaName(name);
								} else if ("id".equals(gameareaNode
										.getNodeName())) {
									String id = gameareaNode.getTextContent();
									nutsNetGoodsAreaInfo.setGameAreaId(id);
								} else if ("gamesrv_s".equals(gameareaNode
										.getNodeName())) {
									Element gamesrv_s = (Element) gameareaNode
											.getChildNodes();
									NodeList gamesrv_sNodes = gamesrv_s
											.getChildNodes();

									for (int m = 0; m < gamesrv_sNodes
											.getLength(); m++) {
										Node gamesrv_sNode = gamesrv_sNodes
												.item(m);
										if ("gamesrv".equals(gamesrv_sNode
												.getNodeName())) {
											Element gamesrv = (Element) gamesrv_sNode
													.getChildNodes();
											NodeList gamesrvNodes = gamesrv
													.getChildNodes();

											NutsNetGoodsServerInfo nutsNetGoodsServerInfo = new NutsNetGoodsServerInfo();
											nutsNetGoodsServerInfo
													.setGoodsId(goodsId);
											nutsNetGoodsServerInfo
													.setGameAreaName(nutsNetGoodsAreaInfo
															.getGameAreaName());
											nutsNetGoodsServerInfo
													.setGameAreaId(nutsNetGoodsAreaInfo
															.getGameAreaId());
											for (int n = 0; n < gamesrvNodes
													.getLength(); n++) {
												Node gamesrvNode = gamesrvNodes
														.item(n);
												if ("name".equals(gamesrvNode
														.getNodeName())) {
													String name = gamesrvNode
															.getTextContent();
													nutsNetGoodsServerInfo
															.setGamesrvName(name);
												} else if ("id"
														.equals(gamesrvNode
																.getNodeName())) {
													String id = gamesrvNode
															.getTextContent();
													nutsNetGoodsServerInfo
															.setGamesrvId(id);
												}
											}
											// 把该对象中的值插入到数据库(nutsnet_game_server_info数据表中)
											nutsNetGoodsServerInfoList
													.add(nutsNetGoodsServerInfo);
											map.put("nutsNetGoodsServerInfoList",
													nutsNetGoodsServerInfoList);
										}
									}
								}
							}
							// 把该对象中的值插入到数据库(nutsnet_game_area_info数据表中)
							nutsNetGoodsAreaInfoList.add(nutsNetGoodsAreaInfo);
							map.put("nutsNetGoodsAreaInfoList",
									nutsNetGoodsAreaInfoList);
						}
					}
				} else if ("choosegem_s".equals(node.getNodeName())) { // 第二层节点
					Element choosegem_s = (Element) node.getChildNodes();
					NodeList choosegem_sNodes = choosegem_s.getChildNodes();

					List<ChooseGemInfo> chooseGemInfoList = new ArrayList<ChooseGemInfo>();
					for (int j = 0; j < choosegem_sNodes.getLength(); j++) {
						Node choosegem_sNode = choosegem_sNodes.item(j);
						if ("choosegem".equals(choosegem_sNode.getNodeName())) {
							Element choosegem = (Element) choosegem_sNode
									.getChildNodes();
							NodeList choosegemNodes = choosegem.getChildNodes();

							ChooseGemInfo chooseGemInfo = new ChooseGemInfo();
							chooseGemInfo.setGoodsId(goodsId);
							for (int k = 0; k < choosegemNodes.getLength(); k++) {
								Node choosegemNode = choosegemNodes.item(k);
								if ("name".equals(choosegemNode.getNodeName())) {
									String name = choosegemNode
											.getTextContent();
									chooseGemInfo.setChoosegemName(name);
								} else if ("id".equals(choosegemNode
										.getNodeName())) {
									String id = choosegemNode.getTextContent();
									chooseGemInfo.setChoosegemId(id);
								}
							}
							// 把该对象中的值插入到数据库(nutsnet_choosegem_info数据表中)
							chooseGemInfoList.add(chooseGemInfo);
							map.put("chooseGemInfoList", chooseGemInfoList);
						}
					}
				} else if ("accounttype_s".equals(node.getNodeName())) { // 第二层节点
					Element accounttype_s = (Element) node.getChildNodes();
					NodeList accounttype_sNodes = accounttype_s.getChildNodes();

					List<AccountTypeInfo> accountTypeInfoList = new ArrayList<AccountTypeInfo>();
					List<NutsNetGoodsAreaInfo> nutsNetGoodsAreaInfoList = new ArrayList<NutsNetGoodsAreaInfo>();
					List<NutsNetGoodsServerInfo> nutsNetGoodsServerInfoList = new ArrayList<NutsNetGoodsServerInfo>();
					for (int j = 0; j < accounttype_sNodes.getLength(); j++) {
						Node accounttype_sNode = accounttype_sNodes.item(j);
						if ("accounttype".equals(accounttype_sNode
								.getNodeName())) {
							Element accounttype = (Element) accounttype_sNode
									.getChildNodes();
							NodeList accounttypeNodes = accounttype
									.getChildNodes();

							AccountTypeInfo accountTypeInfo = new AccountTypeInfo();
							accountTypeInfo.setGoodsId(goodsId);
							for (int k = 0; k < accounttypeNodes.getLength(); k++) {
								Node accounttypeNode = accounttypeNodes.item(k);
								if ("name"
										.equals(accounttypeNode.getNodeName())) {
									String name = accounttypeNode
											.getTextContent();
									accountTypeInfo.setAccountTypeName(name);
								} else if ("id".equals(accounttypeNode
										.getNodeName())) {
									String id = accounttypeNode
											.getTextContent();
									accountTypeInfo.setAccountTypeId(id);
								} else if ("gamearea_s".equals(accounttypeNode
										.getNodeName())) {
									Element gamearea_s = (Element) accounttypeNode
											.getChildNodes();
									NodeList gamearea_sNodes = gamearea_s
											.getChildNodes();

									NutsNetGoodsAreaInfo nutsNetGoodsAreaInfo = new NutsNetGoodsAreaInfo();
									nutsNetGoodsAreaInfo.setGoodsId(goodsId);
									nutsNetGoodsAreaInfo
											.setAccountTypeName(accountTypeInfo
													.getAccountTypeName());
									nutsNetGoodsAreaInfo
											.setAccountTypeId(accountTypeInfo
													.getAccountTypeId());
									for (int l = 0; l < gamearea_sNodes
											.getLength(); l++) {
										Node gamearea_sNode = gamearea_sNodes
												.item(l);
										if ("gamearea".equals(gamearea_sNode
												.getNodeName())) {
											Element gamearea = (Element) gamearea_sNode
													.getChildNodes();
											NodeList gameareaNodes = gamearea
													.getChildNodes();
											for (int m = 0; m < gameareaNodes
													.getLength(); m++) {
												Node gameareaNode = gameareaNodes
														.item(m);
												if ("name".equals(gameareaNode
														.getNodeName())) {
													String name = gameareaNode
															.getTextContent();
													nutsNetGoodsAreaInfo
															.setGameAreaName(name);
												} else if ("id"
														.equals(gameareaNode
																.getNodeName())) {
													String id = gameareaNode
															.getTextContent();
													nutsNetGoodsAreaInfo
															.setGameAreaId(id);
												} else if ("gamesrv_s"
														.equals(gameareaNode
																.getNodeName())) {
													Element gamesrv_s = (Element) gameareaNode
															.getChildNodes();
													NodeList gamesrv_sNodes = gamesrv_s
															.getChildNodes();

													NutsNetGoodsServerInfo nutsNetGoodsServerInfo = new NutsNetGoodsServerInfo();
													nutsNetGoodsServerInfo
															.setAccountTypeName(accountTypeInfo
																	.getAccountTypeName());
													nutsNetGoodsServerInfo
															.setAccountTypeId(accountTypeInfo
																	.getAccountTypeId());
													nutsNetGoodsServerInfo
															.setGameAreaName(nutsNetGoodsAreaInfo
																	.getGameAreaName());
													nutsNetGoodsServerInfo
															.setGameAreaId(nutsNetGoodsAreaInfo
																	.getGameAreaId());
													for (int n = 0; n < gamesrv_sNodes
															.getLength(); n++) {
														Node gamesrv_sNode = gamesrv_sNodes
																.item(n);
														if ("gamesrv"
																.equals(gamesrv_sNode
																		.getNodeName())) {
															Element gamesrv = (Element) gamesrv_sNode
																	.getChildNodes();
															NodeList gamesrvNodes = gamesrv
																	.getChildNodes();
															for (int o = 0; o < gamesrvNodes
																	.getLength(); o++) {
																Node gamesrvNode = gamesrvNodes
																		.item(o);
																if ("name"
																		.equals(gamesrvNode
																				.getNodeName())) {
																	String name = gamesrvNode
																			.getTextContent();
																	nutsNetGoodsServerInfo
																			.setGamesrvName(name);
																} else if ("id"
																		.equals(gamesrvNode
																				.getNodeName())) {
																	String id = gamesrvNode
																			.getTextContent();
																	nutsNetGoodsServerInfo
																			.setGamesrvId(id);
																}
															}
														}
														// 把该对象中的值插入到数据库(nutsnet_game_server_info数据表中)
														nutsNetGoodsServerInfoList
																.add(nutsNetGoodsServerInfo);
														map.put("nutsNetGoodsServerInfoList",
																nutsNetGoodsServerInfoList);
													}
												}
											}
										}
										// 把该对象中的值插入到数据库(nutsnet_game_area_info数据表中)
										nutsNetGoodsAreaInfoList
												.add(nutsNetGoodsAreaInfo);
										map.put("nutsNetGoodsAreaInfoList",
												nutsNetGoodsAreaInfoList);
									}
								}
							}
							// 把该对象中的值插入到数据库(nutsnet_accounttype_info数据表中)
							accountTypeInfoList.add(accountTypeInfo);
							map.put("accountTypeInfoList", accountTypeInfoList);
						}
					}
				}

			}
			goodsdetailTopList.add(nutsNetGoodsDetailTop);
			map.put("goodsdetailTopList", goodsdetailTopList);
		} catch (Exception e) {
			log.error(e);
		}

		return map;
	}

	/**
	 * 
	 * @param args
	 */
	// public static void main(String[] args) {
	// Map<String, Object> map = new HashMap<String, Object>();
	// map = parseXmlOfGoodsDetailForTrade("", "1237");
	//
	//
	// List<ChargeTypeInfo> chargetypeList = null;
	// List<NutsNetGoodsAreaInfo> nutsNetGoodsAreaInfoList = null;
	// List<NutsNetGoodsServerInfo> nutsNetGoodsServerInfoList = null;
	// List<AccountTypeInfo> accountTypeInfoList = null;
	// List<ChooseGemInfo> chooseGemInfoList = null;
	//
	// chargetypeList = (List<ChargeTypeInfo>) map.get("chargetypeList");
	// nutsNetGoodsAreaInfoList = (List<NutsNetGoodsAreaInfo>)
	// map.get("nutsNetGoodsAreaInfoList");
	// nutsNetGoodsServerInfoList = (List<NutsNetGoodsServerInfo>)
	// map.get("nutsNetGoodsServerInfoList");
	// accountTypeInfoList = (List<AccountTypeInfo>)
	// map.get("accountTypeInfoList");
	// chooseGemInfoList = (List<ChooseGemInfo>) map.get("chooseGemInfoList");
	//
	// }

}
